home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 138
/
Volume 138 Aug 19 2011 - Damaged.iso
/
Games
/
hopes_babysitting_maze.swf
/
scripts
/
__Packages
/
Classes
/
bsmEntity.as
< prev
next >
Wrap
Text File
|
2011-08-19
|
1KB
|
64 lines
class Classes.bsmEntity
{
function bsmEntity(t_data, t_levelPath)
{
this.assetID = t_data.assetID;
this.x = t_data.x;
this.y = t_data.y;
this.levelPath = t_levelPath;
this.xMove = 0;
this.yMove = 0;
}
function spawn(t_path, t_depth)
{
this.path = t_path;
this.mc = t_path.attachMovie(this.assetID,this.assetID + t_depth,t_depth);
this.mc.stop();
this.placeAt(this.x,this.y);
this.hdWidth = this.baseWidth = this.mc._width;
this.hdHeight = this.baseHeight = this.mc._height;
this.hidden = false;
this.render();
}
function step(t_elapsed)
{
this.update(t_elapsed);
this.move();
this.render();
}
function update(t_elapsed)
{
}
function move()
{
this.x += this.xMove;
this.y += this.yMove;
}
function render()
{
this.mc._x = this.x - this.baseWidth / 2;
this.mc._y = this.y - this.baseHeight / 2;
}
function hide()
{
this.hidden = true;
this.mc._visible = false;
}
function show()
{
trace("SHOW");
this.hidden = false;
this.mc._visible = true;
}
function placeAt(t_x, t_y)
{
this.x = t_x;
this.y = t_y;
}
function clear()
{
this.mc.removeMovieClip();
false;
}
}